package it.polimi.traveldream.web.beans;

import it.polimi.traveldream.ejb.management.PackDTO;
import it.polimi.traveldream.ejb.management.PackMng;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean(name = "modBean")
@SessionScoped
public class ModificaBean {
	
	@EJB
	private PackMng packMgr;
	
	private PackDTO selectedPack = new PackDTO();

	public PackDTO getSelectedPack() {
		return selectedPack;
	}

	public void setSelectPack(PackDTO selectedPack) {
		this.selectedPack = selectedPack;
	}
	
	public String save() {
		packMgr.save(selectedPack);
		return "/pagine_impiegati/index?faces-redirect=true";
	}
	
	

}
